package kr.saeildamil.androidforstudy2.ch23;

import kr.saeildamil.androidforstudy2.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class ListAnimationTest extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch23_listanimationtest);
		
		ArrayAdapter<CharSequence> Adapter;
		Adapter = ArrayAdapter.createFromResource(this, R.array.planet, android.R.layout.simple_list_item_1);
		
		ListView arlist = (ListView) findViewById(R.id.ch23_listanimation_list);
		arlist.setAdapter(Adapter);
		
		/*AnimationSet aniSet = new AnimationSet(true);
		Animation rtl = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 1.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f);
		rtl.setDuration(1000);
		aniSet.addAnimation(rtl);
		
		Animation alpha = new AlphaAnimation(0.0f, 1.0f);
		alpha.setDuration(1000);
		aniSet.addAnimation(alpha);
		
		LayoutAnimationController aniController = new LayoutAnimationController(aniSet, 0.5f);
		arlist.setLayoutAnimation(aniController);
		*/
		
		overridePendingTransition(R.anim.translatereverse, 0);
	}

	@Override
	protected void onPause() {
		super.onPause();
		overridePendingTransition(0, R.anim.translate);
	}
}
